import api_address from "./api_address";
import axios from 'axios'

// 请求所有博客的长度
export const blogItemLength = () => {
    return axios.get(api_address.blogItemLength)
}

// 网站名称和底部信息
export const getmainmesage = () => {
    return axios.get(api_address.getmainmesage)
}

// 首页请求轮播图
export const getbanner = () => {
    return axios.get(api_address.getbanner)
}
// 首页博客渲染
export const blogItem = (data) => {
    return axios.get(api_address.blogItem, {
        params: data
    })
}
// 请求所有的文章allblog
export const allblog = () => {
    return axios.get(api_address.allblog)
}


// 请求博客文章内容页
export const blogContent = (data) => {
    return axios.get(api_address.blogContent, {
        params: data
    })
}

// 用户请求头像和昵称
export const getUserMessage = (data) => {
    return axios.get(api_address.getUserMessage, {
        params: data
    })
}

// 发送评论请求
export const sendComment = (data) => {
    return axios.post(api_address.sendComment,
        data
    )
}

// 添加评论的 回复
export const replycomment = (data) => {
    return axios.post(api_address.replycomment,
        data
    )
}

// 请求当前评论的回复searchreplylist
export const searchreplylist = (data) => {
    return axios.post(api_address.searchreplylist,
        data
    )
}

// 请求当前文章的评论getcomment
export const getcomment = (data) => {
    return axios.get(api_address.getcomment, {
        params: data
    })
}

// 分类页 请求所有分类
export const getblogclass = () => {
    return axios.get(api_address.blogclasspage.getblogclass)
}

// 
export const selectclass = (data) => {
    return axios.get(api_address.blogclasspage.selectclass, {
        params: data
    })
}

// 搜索页
export const getSearch = (data) => {
    return axios.get(api_address.getSearch, {
        params: data
    })
}
// 随机一句话NavBar
export const navOneWord = () => {
    return axios.get(api_address.navOneWord)
}

// 发送留言板
export const sendMessageBoard = (data) => {
    return axios.post(api_address.sendMessageBoard, data)
}

// 请求所有留言

export const getmessageboard = () => {
    return axios.get(api_address.getmessageboard)
}